package com.CusterRelSys.service.impl;

import com.CusterRelSys.entity.CstActivity;
import com.CusterRelSys.mapper.ActivityesMapperZyh;
import com.CusterRelSys.service.ActivityesMapperServiceZyh;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
@Service
public class ActivityesMapperServiceImplZyh implements ActivityesMapperServiceZyh{
    @Autowired
    private ActivityesMapperZyh activityesMapperZyh;
    @Override
    public List<CstActivity> queryActivityByNo(String atvCustNo) {
        List<CstActivity> cstActivities = activityesMapperZyh.queryActivityByNo(atvCustNo);
        if(cstActivities.size()>0){
            return cstActivities;
        }
        return null;
    }

    @Override
    public CstActivity queryActivityById(Integer atvId) {
        CstActivity cstActivity = activityesMapperZyh.queryActivityById(atvId);
        if(cstActivity!=null){
            return cstActivity;
        }
        return null;
    }

    @Override
    public int addActivites(CstActivity cstActivity) {
        return activityesMapperZyh.addActivites(cstActivity)>0?1:0;
    }
    @Override
    public int updateActivites(CstActivity cstActivity) {

        return activityesMapperZyh.updateActivites(cstActivity)>0?1:0;
    }
    @Override
    public int delActivites(Integer atvId) {
        return activityesMapperZyh.delActivites(atvId)>0?1:0;
    }
}
